package com.gk.company.view.bottom.item
{
	import com.gk.app.GT;
	import com.gk.company.interfaces.IUserInfoVo;
	import com.gk.init.model.vo.UserInfoVo;
	import com.gk.util.GameSprite;
	import com.gk.util.component.Label;
	
	import flash.display.DisplayObjectContainer;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	
	public class FriendItemView extends GameSprite implements IUserInfoVo
	{
		private var picCt:GameSprite;
		private var nameLabel:Label;
		
		private const W:int = 80;
		private const H:int = 100;
		private var userVo:UserInfoVo;
		
		public function FriendItemView(vo:UserInfoVo,parent:DisplayObjectContainer=null, xpos:Number=0, ypos:Number=0)
		{
			super(parent, xpos, ypos);
			
			draw(W,H,0,0.1);
			
			this.userVo = vo;
			
			picCt = new GameSprite(this,5,5);
			picCt.draw(70,70,0xcccccc,0.2);
			GT.getImage(picCt,vo.user_pic,true,70,70);
			
			this.nameLabel = new Label(this,0,80,vo.user_name,false);
			this.nameLabel.setSize(80,20);
			var t:TextFormat = new TextFormat();
			t.align = TextFormatAlign.CENTER;
			this.nameLabel.textField.defaultTextFormat = t;
		}
		
		public function get userInfoVo():UserInfoVo
		{
			return userVo;
		}
		
		public function set userInfoVo(value:UserInfoVo):void
		{
			userVo = value;
		}
		
	}
}